package com.example1;

/**
 * @author 周楠
 * @Date 2023/03/12/上午 10:37
 */
public class ManagerHandler extends ApproveAbstractHandler{

    public ManagerHandler(String name) {
        super(name);
    }

    @Override
    public boolean deal(StaffLeaveRequest staffLeaveRequest) {
        if (staffLeaveRequest.getDays() >= 3 && staffLeaveRequest.getDays() < 10){
            //3到10天需要找经理签字
            System.out.println(this.name + "对"+ staffLeaveRequest.getName() + "的" + staffLeaveRequest.getDays() +"天请假时间，进行审批--------------> 审批完成");
            return true;
        }else {
            //大于10天 进入 总经理签字
            System.out.println(this.name + "对"+ staffLeaveRequest.getName() + "的" + staffLeaveRequest.getDays() +"天请假时间，进行审批--------------> 审批完成");
            this.getNextHandler().deal(staffLeaveRequest);
            return true;
        }
    }
}
